package net.maku.utils;

import java.util.Random;

public class InviteCodeGenerator {
    public static String genCode() {
        Random random = new Random();
        String digits = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ"; // 去掉了0, 1, 5, 6, 8, 9 和字母O, I
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 6; i++) {
            int index = random.nextInt(digits.length());
            char randomChar = digits.charAt(index);
            sb.append(randomChar);
        }
        return sb.toString();
    }
 
    public static void main(String[] args) {
        String recommendationCode = genCode();
        System.out.println("Generated Recommendation Code: " + recommendationCode);
    }
}



